import { post, get } from '../http'
// -------------------------------供应商资料-----------------------------
// 新增供应商
export const createSupplier = (paylaod?: any) => {
  return post('/user/v1/supplier/createSupplier', paylaod)
}
// 删除供应商
export const deleteSupplier = (paylaod?: any) => {
  return post('/user/v1/supplier/deleteSupplier', paylaod)
}
// 供应商列表
export const findSupperPage = (paylaod?: any) => {
  return get('/user/v1/supplier/findSupperPage', paylaod)
}
// 供应商列表-不分页
export const findSupperList = (paylaod?: any) => {
  return get('/user/v1/supplier/findSupperList', paylaod)
}
// 供应商详情
export const getSupplierInfo = (paylaod?: any) => {
  return get('/user/v1/supplier/getSupplierInfo', paylaod)
}
// 更新供应商
export const updateSupplier = (paylaod?: any) => {
  return post('/user/v1/supplier/updateSupplier', paylaod)
}
// 批量启用/禁用供应商
export const updateSupplierStatus = (paylaod?: any) => {
  return post('/user/v1/supplier/updateSupplierStatus', paylaod)
}

// -------------------------------智能补货-----------------------------

// 智能补货列表
export const findReplenishPage = (paylaod?: any) => {
  return get('/procurement/v1/intellectReplenish/findReplenishPage', paylaod)
}
// 智能补货-仓内库存调拨列表
export const findReplenishTransList = (paylaod?: any) => {
  return get('/procurement/v1/intellectReplenish/findReplenishTransList', paylaod)
}
// 智能补货-确认调拨
export const replenishConfirmTrans = (paylaod?: any) => {
  return post('/procurement/v1/intellectReplenish/replenishConfirmTrans', paylaod)
}
// 刷新智能补货
export const refreshReplenish = (paylaod?: any) => {
  return post('/procurement/v1/intellectReplenish/refreshReplenish', paylaod)
}

// -------------------------------采购计划-----------------------------

// 创建采购计划
export const createPurchasePlan = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/plan/createPurchasePlan', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 编辑采购计划
export const updatePurchasePlan = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/plan/updatePurchasePlan', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购计划列表
export const findPurchasePlanPage = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/plan/findPurchasePlanPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购计划根据状态统计数量
export const findPurchasePlanCountByStatus = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/plan/findPurchasePlanCountByStatus', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 提交采购计划
export const commitPurchasePlan = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/plan/commitPurchasePlan', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 作废采购计划
export const cancelPurchasePlan = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/plan/cancelPurchasePlan', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 撤回采购计划
export const revokePurchasePlan = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/plan/revokePurchasePlan', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 审核采购计划
export const auditPurchasePlan = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/plan/auditPurchasePlan', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购计划日志列表
export const findPurchasePlanLogPage = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/plan/findPurchasePlanLogPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 获取采购计划详情
export const getPurchasePlanInfo = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/plan/getPurchasePlanInfo', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 查询采购和库存数据
export const findPurchaseAndInventoryData = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/plan/findPurchaseAndInventoryData', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购计划关联采购单明细查询
export const findPurchaseItemByPlan = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/plan/findPurchaseItemByPlan', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购计划关联交货单明细查询
export const findDeliveryItemByPlan = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/plan/findDeliveryItemByPlan', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购计划关联入库单明细查询
export const findReceiptItemByPlan = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/plan/findReceiptItemByPlan', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// -------------------------------待采购明细-----------------------------

// 待采购明细列表
export const findStayPurchaseItemPage = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/item/findStayPurchaseItemPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 待采购明细根据状态统计数量
export const findStayPurchaseItemCountByStatus = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/item/findStayPurchaseItemCountByStatus', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 待采购明细分配供应商
export const setStayPurchaseItemSupplier = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/item/setStayPurchaseItemSupplier', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 待采购明细截单
export const cutoffStayPurchaseItem = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/item/cutoffStayPurchaseItem', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购下单
export const placePurchaseOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/item/placePurchaseOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// -------------------------------采购订单-----------------------------

// 采购订单列表
export const findPurchasePage = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/order/findPurchasePage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购订单根据状态统计数量
export const findPurchaseCountByStatus = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/order/findPurchaseCountByStatus', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 创建采购订单
export const createPurchaseOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/order/createPurchaseOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 更新采购订单
export const updatePurchaseOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/order/updatePurchaseOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 提交采购订单
export const commitPurchaseOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/order/commitPurchaseOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 审核采购订单
export const auditPurchaseOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/order/auditPurchaseOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 撤回采购订单
export const revokePurchaseOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/order/revokePurchaseOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 作废采购订单
export const cancelPurchaseOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/order/cancelPurchaseOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 修改采购员
export const setPurchaseHeader = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/order/setPurchaseHeader', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 创建交货单
export const createDeliveryOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/order/createDeliveryOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购订单截单
export const cutoffPurchaseOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/order/cutoffPurchaseOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 获取采购订单详情
export const getPurchaseInfo = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/order/getPurchaseInfo', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购订单关联交货单明细查询
export const findDeliveryItemByPurchase = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/order/findDeliveryItemByPurchase', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购订单关联交货单信息查询
export const findDeliveryByPurchase = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/order/findDeliveryByPurchase', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购订单关联入库单信息查询
export const findReceiptByPurchase = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/order/findReceiptByPurchase', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// -------------------------------采购交货单-----------------------------

// 采购交货单列表
export const findDeliveryPage = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/delivery/findDeliveryPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购订单根据状态统计数量
export const findDeliveryCountByStatus = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/delivery/findDeliveryCountByStatus', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 作废(删除)采购交货单
export const cancelDeliveryOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/delivery/cancelDeliveryOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 撤回采购交货单
export const revokeDeliveryOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/delivery/revokeDeliveryOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 质检(处理)采购交货单
export const inspectDeliveryOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/delivery/inspectDeliveryOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 签收采购交货单
export const signDeliveryOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/delivery/signDeliveryOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购交货单入库
export const receiptDeliveryOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/delivery/receiptDeliveryOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购交货单提交入库
export const submitDeliveryReceipt = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/delivery/submitDeliveryReceipt', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 获取采购交货单详情
export const getDeliveryInfo = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/delivery/getDeliveryInfo', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 更新交货单
export const updateDeliveryOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/delivery/updateDeliveryOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购交货单关联入库单信息查询
export const findReceiptByDelivery = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/delivery/findReceiptByDelivery', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// -------------------------------供应商报价-----------------------------

// 采购报价列表
export const findPurchaseQuotePage = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/quote/findPurchaseQuotePage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购报价提交审核
export const commitPurchaseQuote = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/commitPurchaseQuote', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购报价审核
export const auditPurchaseQuote = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/auditPurchaseQuote', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 删除采购报价
export const deletePurchaseQuote = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/deletePurchaseQuote', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 创建采购报价
export const createPurchaseQuote = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/createPurchaseQuote', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 更新采购报价
export const updatePurchaseQuote = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/updatePurchaseQuote', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 启用采购报价
export const enablePurchaseQuote = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/enablePurchaseQuote', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 禁用采购报价
export const disablePurchaseQuote = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/disablePurchaseQuote', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购报价可用列表-不分页
export const findAvailableQuoteList = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/findAvailableQuoteList', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 报价撤回草稿箱
export const revokePurchaseQuote = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/revokePurchaseQuote', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 设置报价采购员
export const setQuotePurchaseUser = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/setQuotePurchaseUser', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 变更报价
export const changePurchaseQuote = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/changePurchaseQuote', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// -------------------------------FBA发货单-业务-----------------------------

// FBA发货单列表（业务）1
export const findFbaShipmentPageBySale = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/findFbaShipmentPageBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单根据状态统计数量（业务）2
export const findFbaShipmentCountBySaleStatus = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/findFbaShipmentCountBySaleStatus', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 创建FBA发货单（业务）3
export const createFbaShipmentBySale = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/createFbaShipmentBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 更新FBA发货单（业务）4
export const updateFbaShipmentBySale = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/updateFbaShipmentBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 删除FBA发货单（业务）5
export const deleteFbaShipmentBySale = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/deleteFbaShipmentBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 提交FBA发货单（业务）6
export const submitFbaShipmentBySale = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/submitFbaShipmentBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 撤回FBA发货单到待处理7
export const revokeFbaShipmentToDraftBySale = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/revokeFbaShipmentToDraftBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 查询可合并FBA发货单列表（业务）8
export const findFbaShipmentListByMerge = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/findFbaShipmentListByMerge', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 合并FBA发货单（业务）9
export const mergeFbaShipmentBySale = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/mergeFbaShipmentBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 获取FBA发货单详情10
export const getFbaShipmentInfo = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/getFbaShipmentInfo', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 获取FBA发货单详情11
export const getFbaShipmentInfoByBillNo = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/getFbaShipmentInfoByBillNo', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 撤回装箱中
export const revokeFbaShipmentToInboxBySale = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/revokeFbaShipmentToInboxBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 查询FBA和库存数据（业务）13
export const findFbaAndInventoryData = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/findFbaAndInventoryData', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 解锁FBA发货单库存14
export const unlockFbaShipment = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/unlockFbaShipment', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单转待发货15
export const transFbaShipmentToShipBySale = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/transFbaShipmentToShipBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 同步FBA亚马逊货件16
export const syncFbaShipmentAmazon = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/syncFbaShipmentAmazon', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 获取亚马逊货件信息17
export const getAmazonFbaShipment = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/getAmazonFbaShipment', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 获取亚马逊货件明细18
export const getAmazonFbaShipmentItems = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/getAmazonFbaShipmentItems', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单绑定亚马逊货件19
export const bindFbaShipmentBySale = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/bindFbaShipmentBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 锁定FBA发货单库存20
export const lockFbaShipment = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/lockFbaShipment', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 查询FBA发货单明细相关库存21
export const findShipmentSkuDetailInventory = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/findShipmentSkuDetailInventory', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 下载FBA发货单数据22
export const downloadFbaShipmentMskuData = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/downloadFbaShipmentMskuData', paylaod, { responseType: 'blob' })
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单实时看板（业务员）
export const findFbaShipmentStatisticsTimeBySale = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/statistics/findFbaShipmentStatisticsTimeBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单实时看板合计（业务员）
export const findFbaShipmentStatisticsTimeSumBySale = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/statistics/findFbaShipmentStatisticsTimeSumBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单实时看板（店铺）
export const findFbaShipmentStatisticsTimeByShop = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/statistics/findFbaShipmentStatisticsTimeByShop', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单实时看板合计（店铺）
export const findFbaShipmentStatisticsTimeSumByShop = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/statistics/findFbaShipmentStatisticsTimeSumByShop', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单实时数量看板（店铺）
export const findFbaShipmentCountTimeByShop = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/statistics/findFbaShipmentCountTimeByShop', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单报表（业务员）
export const findFbaShipmentStatisticsBySale = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/statistics/findFbaShipmentStatisticsBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单报表合计（业务员）
export const findFbaShipmentStatisticsSumBySale = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/statistics/findFbaShipmentStatisticsSumBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单报表（店铺）
export const findFbaShipmentStatisticsByShop = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/statistics/findFbaShipmentStatisticsByShop', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单报表合计（店铺）
export const findFbaShipmentStatisticsSumByShop = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/statistics/findFbaShipmentStatisticsSumByShop', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单确认发货
export const confirmFbaShipmentShipBySale = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/confirmFbaShipmentShipBySale', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// -------------------------------FBA发货单-仓储-----------------------------

// FBA发货单列表（仓储）1
export const findFbaShipmentPageByStore = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/findFbaShipmentPageByStore', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单根据状态统计数量（仓储）2
export const findFbaShipmentCountByStoreStatus = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/findFbaShipmentCountByStoreStatus', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单转待发货15
export const transFbaShipmentToShipByStore = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/transFbaShipmentToShipByStore', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单绑定亚马逊货件
export const bindFbaShipmentByStore = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/bindFbaShipmentByStore', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 撤回FBA发货单到待处理
export const revokeFbaShipmentToDraftByStore = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/revokeFbaShipmentToDraftByStore', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 撤回装箱中
export const revokeFbaShipmentToInboxByStore = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/revokeFbaShipmentToInboxByStore', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 更新FBA发货单（仓储）3
export const updateFbaShipmentByStore = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/updateFbaShipmentByStore', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单确认装箱4
export const confirmFbaShipmentInBoxByStore = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/confirmFbaShipmentInBoxByStore', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 设置FBA发货单报关信息（仓储）5
export const setFbaShipmentDeclareByStore = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/setFbaShipmentDeclareByStore', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单物流下单（仓储）6
export const placeFbaShipmentLogisticsByStore = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/placeFbaShipmentLogisticsByStore', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA发货单确认发货（仓储）7
export const confirmFbaShipmentShipByStore = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/confirmFbaShipmentShipByStore', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 获取FBA发货单箱单
export const getFbaShipmentPackingLabels = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/getFbaShipmentPackingLabels', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// -------------------------------FBA收货地址列表-----------------------------

// FBA收货地址列表1
export const findFbaShipmentAddressList = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/findFbaShipmentAddressList', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// -------------------------------采购入库单-----------------------------

//采购入库单列表
export const findReceiptPage = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/receipt/findReceiptPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//拒收采购入库单
export const refuseReceiptOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/receipt/refuseReceiptOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//签收采购入库单
export const signReceiptOrder = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/receipt/signReceiptOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//签收采购入库单
export const findReceiptLogPage = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/receipt/findReceiptLogPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// -------------------------------FBA货件-亚马逊-----------------------------
//FBA亚马逊货件列表
export const findFbaShipmentAmazonPage = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/amazon/findFbaShipmentAmazonPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//更新FBA货件
export const updateAmazonFbaShipments = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/amazon/updateAmazonFbaShipments', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//拉取FBA货件
export const getAmazonFbaShipments = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/amazon/getAmazonFbaShipments', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//获取FBA货件箱单
export const getFbaShipmentAmazonPackingLabels = async (paylaod?: any) => {
  return await post('/procurement/v1/fba/shipment/amazon/getFbaShipmentAmazonPackingLabels', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// -------------------------------FBA货件差异-----------------------------

// FBA货件差异
export const findFbaShipmentDifferentPage = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/different/findFbaShipmentDifferentPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA货件差异汇总
export const findFbaShipmentDifferentSum = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/different/findFbaShipmentDifferentSum', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA货件明细差异
export const findFbaShipmentDetailDifferentPage = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/different/findFbaShipmentDetailDifferentPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA货件明细差异汇总
export const findFbaShipmentDetailDifferentSum = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/different/findFbaShipmentDetailDifferentSum', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA货件收货明细差异
export const findFbaShipmentReceiptPage = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/different/findFbaShipmentReceiptPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// FBA货件收货明细差异汇总
export const findFbaShipmentReceiptSum = async (paylaod?: any) => {
  return await get('/procurement/v1/fba/shipment/different/findFbaShipmentReceiptSum', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// -------------------------------报价变更单-----------------------------

//采购报价变更列表
export const findPurchaseQuoteChangePage = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/quote/change/findPurchaseQuoteChangePage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//提交报价变更单
export const commitPurchaseQuoteChange = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/change/commitPurchaseQuoteChange', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//删除报价变更单
export const deletePurchaseQuoteChange = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/change/deletePurchaseQuoteChange', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//审核报价变更单
export const auditPurchaseQuoteChange = async (paylaod?: any) => {
  return await post('/procurement/v1/purchase/quote/change/auditPurchaseQuoteChange', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//获取采购报价变更详情
export const getPurchaseQuoteChangeInfo = async (paylaod?: any) => {
  return await get('/procurement/v1/purchase/quote/change/getPurchaseQuoteChangeInfo', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// -------------------------------请款池-----------------------------

//采购报价变更列表
export const findPaymentPoolPage = async (paylaod?: any) => {
  return await get('/finance/v1/purchase/payment/pool/findPaymentPoolPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//采购请款池汇总
export const findPaymentPoolSum = async (paylaod?: any) => {
  return await get('/finance/v1/purchase/payment/pool/findPaymentPoolSum', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//采购请款池更新备注
export const updatePaymentPoolRemark = async (paylaod?: any) => {
  return await post('/finance/v1/purchase/payment/pool/updatePaymentPoolRemark', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//采购请款池结束请款
export const closePaymentPoolRequest = async (paylaod?: any) => {
  return await post('/finance/v1/purchase/payment/pool/closePaymentPoolRequest', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//采购请款池重新请款
export const againPaymentPoolRequest = async (paylaod?: any) => {
  return await post('/finance/v1/purchase/payment/pool/againPaymentPoolRequest', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// -------------------------------请款单-----------------------------
//采购请款单新增
export const createPaymentOrder = async (paylaod?: any) => {
  return await post('/finance/v1/purchase/payment/order/createPaymentOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//采购请款单更新
export const updatePaymentOrder = async (paylaod?: any) => {
  return await post('/finance/v1/purchase/payment/order/updatePaymentOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//采购请款单审核
export const auditPaymentOrder = async (paylaod?: any) => {
  return await post('/finance/v1/purchase/payment/order/auditPaymentOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//采购请款单作废
export const cancelPaymentOrder = async (paylaod?: any) => {
  return await post('/finance/v1/purchase/payment/order/cancelPaymentOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//采购请款单列表
export const findPaymentOrderPage = async (paylaod?: any) => {
  return await get('/finance/v1/purchase/payment/order/findPaymentOrderPage', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//采购请款单汇总
export const findPaymentOrderSum = async (paylaod?: any) => {
  return await get('/finance/v1/purchase/payment/order/findPaymentOrderSum', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//采购请款单详情
export const getPaymentOrderInfo = async (paylaod?: any) => {
  return await get('/finance/v1/purchase/payment/order/getPaymentOrderInfo', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//采购请款单支付
export const payPaymentOrder = async (paylaod?: any) => {
  return await post('/finance/v1/purchase/payment/order/payPaymentOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//采购请款单提交审核
export const submitPaymentOrder = async (paylaod?: any) => {
  return await post('/finance/v1/purchase/payment/order/submitPaymentOrder', paylaod)
    .then((res) => res)
    .catch(() => false)
}
//采购请款单更新备注
export const updatePaymentOrderRemark = async (paylaod?: any) => {
  return await post('/finance/v1/purchase/payment/order/updatePaymentOrderRemark', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购定制单
export const pageCustomOrderPurchase = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/purchase/pageCustomOrderPurchase', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购定制单接受或者驳回
export const batchPurchaseTake = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/purchase/batchPurchaseTake', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 批量提交工厂
export const batchPurchaseSumbitSupplier = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/purchase/batchPurchaseSumbitSupplier', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 批量撤回到待接单
export const batchRollbackToWaitAccept = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/purchase/batchRollbackToWaitAccept', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 供应商批量提交验收
export const batchSupplierSubmitVerify = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/supplier/batchSupplierSubmitVerify', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购批量签收/拒收
export const batchPurchaseVerify = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/purchase/batchPurchaseVerify', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 查询仓储库存
export const queryInventory = async (paylaod?: any) => {
  return await get('/inventory/v1/inventory/queryInventory', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 单据撤回到代下单
export const batchRollbackToTaked = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/purchase/batchRollbackToTaked', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// 供应商定制单订单列表
export const supplierPageCustomOrderPurchase = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/supplier/pageCustomOrderPurchase', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 供应商批量接单/拒单
export const batchSupplierTake = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/supplier/batchSupplierTake', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 供应商批量撤回
export const batchRollbackToSupplierWaitDelivery = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/supplier/batchRollbackToSupplierWaitDelivery', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 采购批量提交仓库
export const batchPurchaseSumitWarehouse = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/purchase/batchPurchaseSumitWarehouse', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 定制单状态统计-采购
export const countCustomOrderPurchaseByStatus = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/purchase/countCustomOrderPurchaseByStatus', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 定制单状态统计-供应商
export const supplierCountCustomOrderPurchaseByStatus = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/supplier/countCustomOrderPurchaseByStatus', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// 批量设置采购员
export const batchUpdatePurchaser = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/purchase/batchUpdatePurchaser', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 根据产品SKU查询最近一次数据MAP
export const listLatestCustomOrderPurchase = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/listLatestCustomOrderPurchase', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 获取仓库
export const findSaasAndErpWarehouse = async (paylaod?: any) => {
  return await get('/inventory/v1/warehouse/findSaasAndErpWarehouse', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 批量添加标签
export const batchAddTags = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/batchAddTags', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 批量取消标签
export const batchCancelTags = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/batchCancelTags', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 合并定制图
export const mergeCustomPics = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/mergeCustomPics', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 编辑定制资料
export const batchUpdateCustomInfo = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/batchUpdateCustomInfo', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 根据ID查询定制单采购详情
export const getCustomOrderPurchaseById = async (paylaod?: any) => {
  return await post('/procurement/v1/customOrderPurchase/getCustomOrderPurchaseById', paylaod)
    .then((res) => res)
    .catch(() => false)
}

// 定制单标签列表
export const listByParam = async (paylaod?: any) => {
  return await get('/procurement/v1/tag/listByParam', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// 定制单标签修改
export const saveOrUpdateBatch = async (paylaod?: any) => {
  return await post('/procurement/v1/tag/saveOrUpdateBatch', paylaod)
    .then((res) => res)
    .catch(() => false)
}
// erp的配链
export const listFittingPost = async (paylaod?: any) => {
  return await post('/innererp/v1/erpProduct/listFittingPost', paylaod)
    .then((res) => res)
    .catch(() => false)
}
